<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 *  Gogadgets  Maitai Class
 *
 *  connects to hessian service to get globe gadgets
 *
 * @package     CodeIgniter
 * @subpackage  Libraries
 * @category    Maitai 
 * @author      Carla Missiona
 * @link
 *
 */

/*

	require_once 'file:///appl/magento/lib/Hessian/HessianClient.php';
	require_once 'file:///appl/magento/lib/Hessian/HessianOptions.php';
	

*/


class Gogadgets {

   protected $pk,
	     $sharedSecret,
	     $service,
	     $url = "https://dutyproxydev.globe.com.ph/SuperMegaServicesProxy/servlet/hessian/MaiTaiService",
             $phrase = "portalrequestMAITAI",
	     $opts = new HessianOptions();

function __construct()
{
	
	/* prepare private key */
	$pk = openssl_pkey_get_private( 'url' );

	/* prepare shared secret */
	openssl_private_encrypt( $this->phrase, $this->sharedSecret, $this->pk );
	$this->sharedSecret= base64_encode( $this->sharedSecret ); // ready to use as param na			
	
	/*  sir nakakalito kung ung ssb ( shared secret bean ) param 4 every hessian call ay object/hessian class din sya na gagawan ng hessian call/curl  */

	/*

		sample
		$antispam = new SSB();
		$this->result = $proxy->getPromoList($ssb, $param1, $param2);
	
	*/
 	       
}

function getService(){

 	
	$opts = new HessianOptions();
	$opts->typeMap[ 'GogadgetKey' ] = "com.fluxion.spprovisioning.api.bean.SharedSecretBean"; // --> shared secret bean plang 
	$opts->version = 1;
	$opts->saveRaw=true;
	$opts->transport = "curl";
	$opts->transportOptions = array(
		CURLOPT_SSL_VERIFYHOST => 2,
		CURLOPT_SSL_VERIFYPEER => FALSE,
		CURLOPT_CAINFO => "$CERT_PATH" );
	$this->service = new HessianClient( $this->url, $opts );



}

function getGadgetList(){



}
function getPromoTypeList{



}
function getPromoValidityList(){



}
function getPromoList(){



}

function getCommitmentPeriod(){



}

function checkMsisdn(){



}

function getStoreList(){


}


}//end class


class SSB{




}
?>